//------------Sonic CD EggmanJetpack Script-------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

//-------Aliases-------//
#alias 55: TYPE_EGGMANJETPACK


event ObjectMain
	switch Object.State
	case 0
		if Object.Value0<64
			Object.Value0++
			if Object.Value0>27
				Object.XPos+=32768
				Object.YPos-=131072
			endif
		else
			Object.Value0=0
			Object.State=2
			Object.Value4=Object.YPos
		endif
		break
	case 2
		Object.Value3+=3
		Object.Value3&=255
		Sin256(temp0,Object.Value3)
		temp0<<=11
		Object.XPos+=163840
		Object.YPos=Object.Value4
		Object.YPos-=temp0
		if Object.OutOfBounds==1
			Object.Type=TypeName[BlankObject]
			Object[-1].State=5
			Object[-1].Rotation=0
		endif
		break

	endswitch
endevent


event ObjectDraw
	temp0=Object.Frame
	temp0>>=2
	temp0+=Object.State
	DrawSprite(temp0)
	Object.Frame++
	Object.Frame&=7
endevent


event ObjectStartup
	LoadSpriteSheet("R1/Objects3.gif")
	SpriteFrame(-28,-24,56,56,1,34)
	SpriteFrame(-28,-24,56,56,1,91)
	SpriteFrame(-28,-24,56,56,58,34)
	SpriteFrame(-28,-24,56,56,58,91)
endevent

event RSDK
	LoadSpriteSheet("Global/Display.gif")
	SetEditorIcon(Icon0,SingleIcon,-16,-16,32,32,1,143)
endevent
